﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Gype.UI;

namespace Gype.GUI.Components
{
    public static class BrushCollection
    {
        // BUTTON
        public static Brush ButtonBorder { get; private set; }
        public static Brush ButtonUp { get; private set; }
        public static Brush ButtonDown { get; private set; }
        public static Brush ButtonOverBrush { get; private set; }
        public static Brush ButtonHighlight { get; private set; }
        public static Brush ButtonTextBrush { get; private set; }
        public static Brush ButtonTextBrushHighlight { get; private set; }

        // FRAME
        public static Brush FrameBackground { get; private set; }
        public static Brush FrameBorder { get; private set; }
        public static Brush FrameCaptionText { get; private set; }

        // MENUBAR
        public static Brush MenuBarItemBackground { get; private set; }
        public static Brush MenuBarItemBorder { get; private set; }
        public static Brush MenuBarPopupItemHover { get; private set; }

        // TAB
        public static Brush TabHeaderBackground { get; private set; }
        public static Brush TabHeaderItemBackgroundHover { get; private set; }
        public static Brush TabHeaderItemBackgroundSelect { get; private set; }
        public static Brush TabHeaderItemBackground { get; private set; }
        public static Brush TabHeaderItemBorderSelect { get; private set; }
        public static Brush TabHeaderItemBorder { get; private set; }
        public static Brush TabHeaderTextSelect { get; private set; }
        public static Brush TabHeaderText { get; private set; }

        // CONTACTLIST
        public static Brush ContactListBackground { get; private set; }
        public static Brush ContactListItemSelect { get; private set; }
        public static Brush ContactPopupBorder { get; private set; }
        public static Brush ContactPopupBackground { get; private set; }
        public static Brush ContactListScroll { get; private set; }

        // CONVLIST
        public static Brush ConvListDateHeader { get; private set; }
        public static Brush ConvListDateText { get; private set; }
        public static Brush ConvListConvText { get; private set; }

        public static void InitBrushes(Rendertarget target)
        {
            ButtonUp = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xF09D9D9D));
            ButtonBorder = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xF0333333));
            ButtonDown = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xF09D9D9D));
            ButtonOverBrush = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xF0BDBDBD));
            ButtonTextBrush = Brush.SolidColorBrush(target, System.Drawing.Color.GhostWhite);
            ButtonTextBrushHighlight = Brush.SolidColorBrush(target, System.Drawing.Color.Wheat);
            ButtonHighlight = Brush.RadialGradientBrush(target, new RadialGradientDescription()
            {
                Center = new SlimDX.Vector2(50, 15),
                GradientSize = new SlimDX.Vector2(100, 30),
                HorizontalRadius = 50,
                VerticalRadius = 15,
                Stops = new GradientStop[]
                {
                    new GradientStop() { Color = ConvertExt.ToColor(0xA0AAAAAA), Distance = 0.0f },
                    new GradientStop() { Color = ConvertExt.ToColor(0x60AAAAAA), Distance = 0.5f },
                    new GradientStop() { Color = ConvertExt.ToColor(0xAAAAAA), Distance = 0.7f }
                }
            }
            );

            FrameBackground = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xF04D4D4D));
            FrameBorder = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xFFD2691E));
            FrameCaptionText = Brush.SolidColorBrush(target, System.Drawing.Color.Wheat);

            MenuBarItemBackground = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xF08C8C8C));
            MenuBarItemBorder = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xF0333333));
            MenuBarPopupItemHover = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xE0CFCFCF));

            TabHeaderBackground = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xE0292929));
            TabHeaderItemBackgroundHover = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xE0939393));
            TabHeaderItemBackgroundSelect = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xF0D4D4D4));
            TabHeaderItemBackground = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xF0737373));
            TabHeaderItemBorderSelect = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xFFD2691E));
            TabHeaderItemBorder = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xFF4876FF));
            TabHeaderTextSelect = Brush.SolidColorBrush(target, System.Drawing.Color.DarkSlateGray);
            TabHeaderText = Brush.SolidColorBrush(target, System.Drawing.Color.GhostWhite);

            ContactListBackground = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xE0B0B0B0));
            ContactListItemSelect = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xE0DBDBDB));
            ContactPopupBorder = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xFF777777));
            ContactPopupBackground = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xE0D4D4D4));
            ContactListScroll = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xE0D2691E));

            ConvListDateHeader = Brush.SolidColorBrush(target, ConvertExt.ToColor(0xE0616161));
            ConvListDateText = Brush.SolidColorBrush(target, System.Drawing.Color.GhostWhite);
            ConvListConvText = Brush.SolidColorBrush(target, System.Drawing.Color.DarkSlateGray);
        }
    }
}
